﻿using RRQMMVVM;
using System.Windows;

namespace ViewModel.ViewModels
{
    public class WindowTitleViewModel : ViewModelBase
    {
        public WindowTitleViewModel(Window window)
        {
            CloseCommand = new ExecuteCommand(() => { window.Close(); });
            MaxOrNormalCommand = new ExecuteCommand(() =>
            {
                if (window.WindowState == WindowState.Normal)
                {
                    window.WindowState = WindowState.Maximized;
                }
                else
                {
                    window.WindowState = WindowState.Normal;
                }
            });

            MinimizCommand = new ExecuteCommand(() =>
            {
                window.WindowState = WindowState.Minimized;
            });
        }

        public ExecuteCommand CloseCommand { get; set; }
        public ExecuteCommand MaxOrNormalCommand { get; set; }
        public ExecuteCommand MinimizCommand { get; set; }
    }
}